-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add publish worker #115
Add publish worker #115
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @richardhuaaa and the rest of your teammates on Graphite |
647b702
to
92f5ac8
Compare
b994784
to
cb09162
Compare
92f5ac8
to
6ce44be
Compare
177ea52
to
16b2940
Compare
6ce44be
to
a100969
Compare
16b2940
to
d27f00a
Compare
4467348
to
db44f65
Compare
2b75efb
to
0752a9b
Compare
) | ||
if err != nil { | ||
logger.Error("Failed to insert gateway envelope", zap.Error(err)) | ||
return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a risk here that we infinitely retry on this step or one of the steps above in an unanticipated error case. I think that we should be okay here but a second pair of eyes can't hurt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why the proto marshaling would fail, but if it did we would be in an endless loop of retries here.
Would probably have to be a maliciously crafted payload
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my research, it seems like it fails if some expected fields of the proto are not set. In this case, the proto is OriginatorEnvelope
with two fields that we are setting here, so I expect that we should be able to prevent this error happening.
I still think we should catch the error just in case though, firstly so that we can detect it, secondly so that we don't screw up payload ordering if there is an unanticipated error type that is super common.
0752a9b
to
a8cef43
Compare
gateway_envelopes
tablestaged_originated_envelopes
table - we extract this during the API call, so that the publish worker doesn't need to do any additional unmarshaling or validation.Would particularly love feedback on the error handling in the worker, and if there's any test cases I should add to
service_test.go
.